<%@page import="cn.edu.pku.wxlib.teacher.model.*" %>

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title>Teacher维护</title>
</rapid:override>

<rapid:override name="content">
	<form id="queryForm" name="queryForm" method="get"
		style="display: block;">
		<!-- start of search -->
		<div class="search">
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input type="text"
					class="form-field col-1-5" value="${query.teacherNumber}"
					id="teacherNumber" name="teacherNumber" placeholder="输入教工号">
			</div>
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input type="text"
					class="form-field col-1-5" value="${query.department}"
					id="department" name="department" placeholder="输入部门">
			</div>
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input type="text"
					class="form-field col-1-5" value="${query.direction}"
					id="direction" name="direction" placeholder="输入研究方向">
			</div>
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input type="text"
					class="form-field col-1-5" value="${query.title}"
					id="title" name="title" placeholder="输入职称">
			</div>
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input type="text"
					class="form-field col-1-5" value="${query.office}"
					id="office" name="office" placeholder="输入办公室">
			</div>
			<div class="form-group inline icon search-btn"
				onclick="$('#queryForm').submit();" title="查询">
				<i class="icon-search"></i>
			</div>

		</div>
		<!-- end of search -->
	</form>

	<div class="handleControl">
			<div class="form-group inline">
				<button type="button" class="btn btn-primary" onclick="window.location = '${ctx}/teacher/new'">&nbsp;&nbsp;&nbsp;新增&nbsp;&nbsp;&nbsp;</button>
			</div>
	</div>
		
	<div class="gridTable">	
		<table width="100%"  border="0" cellspacing="0" class="table text-center">
		  <thead>			  
			  <tr>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>
				<th>序号</th>
				<th sortColumn="teacherNumber" >教工号</th>
				<th sortColumn="department" >部门</th>
				<th sortColumn="direction" >研究方向</th>
				<th sortColumn="title" >职称</th>
				<th sortColumn="office" >办公室</th>
				<th style="white-space:nowrap;">操作</th>
			  </tr>			  
		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">
			  <tr>
				<td><input type="checkbox" name="items" value="${item.teacherId}"></td>
				<td><c:out value='${status.count}'/></td>
				<td><c:out value='${item.teacherNumber}'/>&nbsp;</td>
				<td><c:out value='${item.department}'/>&nbsp;</td>
				<td><c:out value='${item.direction}'/>&nbsp;</td>
				<td><c:out value='${item.title}'/>&nbsp;</td>
				<td><c:out value='${item.office}'/>&nbsp;</td>
				<td>
					<a href="${ctx}/teacher/${item.teacherId}">查看</a>&nbsp;&nbsp;
					<a href="${ctx}/teacher/${item.teacherId}/edit">修改</a>&nbsp;&nbsp;
					<a href="${ctx}/teacher/${item.teacherId}" onclick="doRestDelete(this,'你确认删除?');return false;">删除</a>
				</td>
			  </tr>
			  
		  	  </c:forEach>
		  </tbody>
		</table>
	
		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
		
	</div>
</rapid:override>

<rapid:override name="script">
	<script src="${ctx}/scripts/rest.js" ></script>
	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>
	
	<script type="text/javascript" >
		$(document).ready(function() {
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>
<%@ include file="base.jsp" %>
